import requests from './requests.js'

export const getUserInfoBook=()=>{
	return requests({
		method:'GET',
		url:'/api/getUserBookShelf',
		
	})
}
//关注用户
export const getFllowUser =(focusId)=>{
	return requests({
		method:'POST',
		url:'/api/followUser',
		data:{focusId}
	})
}
//取消关注
export const unFllowUser =(focusId)=>{
	return requests({
		method:'POST',
		url:'/api/unFollowUser',
		data:{focusId}
	})
}

export const getFocus =()=>{
	return requests({
		method:'GET',
		url:'/api/getFocus'
	})
}
export const getFans =()=>{
	return requests({
		method:'GET',
		url:'/api/getFans'
	})
}
export const getOtherInfoBook=(id)=>{
	return requests({
		method:'GET',
		url:`/api/getOtherBookShelf?id=${id}`,
		data:{id},
	})
}
export const getOtherInfo=(id)=>{
	return requests({
		method:'GET',
		url:`/api/getOtherUserInfo?id=${id}`,
		data:{
			id
		},
	})
}
export const updateAvatar=(avatar)=>{
	return requests({
		method:'POST',
		url:'/api/updateAvatar',
		data:{
			avatar
		}
	})
}
export const updatePwd=(Pwd)=>{
	return requests({
		method:'POST',
		url:'/api/forgetPassword',
		data:{
			oldPassword:Pwd.oldPd,
			newPassword:Pwd.newPd
		},
	})
}
//修改昵称
export const updateNickname=(nickName)=>{
	return requests({
		method:'POST',
		url:'/api/updateNickname',
		data:{
			nickName
		}
	})
}
//修改性别
export const updateSex=(sex)=>{
	return requests({
		method:'POST',
		url:'/api/updateSex',
		data:{
			sex
		}
	})
}